<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LoginTest</title>
    <script src="../js/userOps.js"></script>
    <script>
        function btnFunc() {
            var Name = document.getElementById("usr_add_name").value;
            var psw = document.getElementById("usr_add_psw").value;
            var token = user_login(Name, psw);
            console.info(token);
            document.getElementById("resp").innerHTML = token;
        }
        function getOrder() {
            var Name = document.getElementById("usr_add_name").value;
            var psw = document.getElementById("usr_add_psw").value;
            var token = user_login(Name, psw);
            console.info(token);
            var jobj = {
                token: token,
                offset:0,
                length:1
            };
            resp = doAjaxCall(jobj,"/api/aixinwu_order_get");
            document.getElementById("resp").innerHTML = JSON.stringify(resp);

        }
    </script>

</head>
<body>
<form id="userAddInfo">
    <table border="1">
        <tr>
            <td>UserName</td>
            <td><input type="text" id="usr_add_name"></td>
        </tr>
        <tr>
            <td>Psw</td>
            <td><input type="password" id="usr_add_psw"></td>
        </tr>
    </table>
    <input type="button" value="Submit" id="usr_add_submit" onclick="btnFunc()">
    <input type="button" value="Order" onclick="getOrder()">
</form>
<div id = "resp"></div>

</body>
</html>